//
//  ILIotAudioParams.h
//  IMIHome
//
//  Created by OrrHsiao on 2021/12/16.
//  Copyright © 2021 上海创米科技有限公司. All rights reserved.
//  暂时只实现了一个阿里的音频参数转化

#import <Foundation/Foundation.h>
#import "ILVideoEnum.h"

NS_ASSUME_NONNULL_BEGIN

/**
 * 音频头
 */
typedef struct{
    /** 采样位宽 */
    int audioBitPerSample;
    /** 采样率 */
    int audioSamplesPerSec;
    /** 通道数 */
    int audioChannel;
    /** 音频编码类型 */
    AudioStreamType audioEncType;
    

}ILAudioParams;


///构造一个默认的音频参数
 //ILAudioParams DEFAULT_AUDIO_PARAMS = {16,16000,1,IL_MEDIA_AUDIO_ENC_G711A};


@interface ILIotAudioParams : NSObject



/// 从物模型中获取音频参数
/// 默认值
/// NSInteger sampleRate = 16000;
/// IMSLinkVisualAudioFormat format = IMSLinkVisualAudioFormatG711a;
/// UInt32 chanel = 1;
/// UInt32 bitsPerSample = 16;
/// @param properties 物模型
+ (ILAudioParams )initAudioParamsWithProperties:(NSDictionary *)properties;

/// 从RN参数中获取音频参数,可能为空
/// @param params RN音频参数{@"audioParams" : @"1"} MONO_16K_G711A = 1; MONO_8K_G711A = 2; MONO_16K_AAC_LC = 3; MONO_8K_AAC_LC = 4;
+ (ILAudioParams )initAudioParamsWithRNParams:(NSDictionary *)params;


@end

NS_ASSUME_NONNULL_END
